import 'package:flutter/material.dart';
import '../../../Pojo/News_Itme_Pojo.dart';
import 'NewsItmeWidget.dart';

class NewsList extends StatelessWidget {
  //定义变量ListArray
  final List<NewsItmePojo> ListArray;

  NewsList({Key? key, required this.ListArray}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    List<Widget> NewsListArray=[];
    for(int i=0;i<ListArray.length;i++){
      NewsListArray.add(NewsItme(NIP: ListArray[i],));
    }

    return Container(
      margin:EdgeInsets.all(4),
      // color: Colors.grey,
      child: Column(
        children: [
          Container(
            height: 40,
            width: double.infinity,
            child: Row(
              children: [
                Container(
                  margin: const EdgeInsets.fromLTRB(8, 0, 0, 0 ),
                  child: const Text(
                    "今日推荐",
                    style: TextStyle(
                      fontSize: 18,
                    ),
                  ),
                )
              ],
            ),
          ),
          ...NewsListArray
        ],
      ),
    );
  }
}
